<template>
  <div class="topic-detail-container">
    <div class="header">
      <van-nav-bar
        title="专题详情"
        left-text="返回"
        left-arrow
        @click-left="$router.back()"
      />
      <!-- 
        @click-right="onClickRight" -->
    </div>

    <div class="banner" ref="banner" v-html="(info.data && info.data.content)"></div>

    <div class="topic-command">专题推荐</div>

    <div class="topic-cards">
      <div
        class="cards-container"
        v-for="item in info.recommendList"
        :key="item.id"
      >
        <div class="card">
          <img :src="item.scene_pic_url" alt="" />
        </div>
        <div class="text">{{ item.title }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { detailaction } from "@/api/topic/TopicDetail";
export default {
  data() {
    return {
      info: {},
    };
  },
  methods: {
    async getdata() {
      let res = await detailaction({ id: this.$route.query.id });
      this.info = res;
    },
  },
  mounted() {
    this.getdata();
  },
};
</script>

<style lang="scss" scoped>
.topic-detail-container {
  width: 100%;
  .topic-command {
    font-size: 38px;
    color: #333333;
    letter-spacing: 0;
    font-weight: 500;
    padding: 60px 0 40px 0;
    text-align: center;
  }
  .topic-cards {
    padding: 0 20px;
    background-color: #f8f8f8;
    .cards-container {
      height: 469px;
      .card {
        height: 343px;
        background-color: #fff;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .text {
        height: 126px;
        padding: 32px 0 0 42px;
        font-size: 30px;
        color: #333333;
        letter-spacing: 0;
        font-weight: 500;
      }
    }
  }
}
</style>
<style lang='scss'>
.topic-detail-container {
  .van-nav-bar__title {
    font-size: 36px;
    color: #333333;
    letter-spacing: 0;
    font-weight: 500;
  }
  .van-nav-bar__text {
    font-size: 31.2px;
    color: #666666;
    letter-spacing: 0;
    font-weight: 400;
  }
  .van-nav-bar .van-icon {
    color: #000;
  }
  img {
    width: 100%;
  }
}
</style>